// import directives
import { App } from 'vue'

import debounce from './debounce'
import throttle from './throttle'
import slideIn from './slide-in'
import scroll from './scroll'

const directivesList: any = {
  // Custom directives
  debounce,
  throttle,
  slideIn,
  scroll,
}

const directives = {
  install: function (app: App<Element>) {
    Object.keys(directivesList).forEach((key) => {
      // 注册自定义指令
      app.directive(key, directivesList[key])
    })
  },
}

export default directives
